package com.realgodo.site.entity.application.vote;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.realgodo.site.entity.application.Application;

/**
 * 投票主体
 * @author bijiqiang E-mail: bijiqiang@gmail.com
 * @version 创建时间：2009-12-13下午03:09:59
 * @since jdk1.5
 * @version 0.1
 */
@Entity(name = "Vote")
@Table(name = "vote")
@Inheritance(strategy = InheritanceType.JOINED)
@PrimaryKeyJoinColumn(name = "id", referencedColumnName = "id")
public class Vote extends Application {

	private static final long serialVersionUID = -6730925015464075501L;

	private String title;
	private String description;
	private Date startTime = new Date();
	private Date endTime;
	private int status;
	
	/**限选的个数*/
	private int count;
	/**投票总数*/
	private Long totalCount = 0L;

	public static final int STATUS_IN = 0;
	public static final int STATUS_END = 1;

	@Column(name = "title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "description", length = 1000)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time", insertable = true, updatable = true)
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "status")
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(name = "count")
	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
	
	@Column(name = "total_count")
	public Long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Long totalCount) {
		this.totalCount = totalCount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_time", insertable = true, updatable = true)
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	
	
}
